package com.filmbooks.model.movie;

import com.filmbooks.api.DoubanApi;
import com.filmbooks.contract.movie.TopMovieContract;
import com.filmbooks.model.home.bean.movie.HotMovieBean;
import com.zyw.horrarndoo.sdk.helper.RetrofitCreateHelper;
import com.zyw.horrarndoo.sdk.helper.RxHelper;

import io.reactivex.Observable;

/**
 * Created by heshuxiang on 2018/3/9.
 * 描述：
 * 公司：盟将威
 * 作者：heshuxiang
 * 日期：2018/3/9.
 * 工程：FilmBooks
 * 包：com.filmbooks.model.movie
 */

public class TopMovieModel implements TopMovieContract.ITopMovieModel {
    public static TopMovieModel newIntsance() {
        return new TopMovieModel();
    }

    @Override
    public Observable<HotMovieBean> getTopMovieList(int start, int count) {
        return RetrofitCreateHelper.createApi(DoubanApi.class, DoubanApi.HOST).getMovieTop250
                (start, count).compose(RxHelper.<HotMovieBean>rxSchedulerHelper());
    }
}
